package com.qfedu.openplateform.manager.service.impl;

import com.qfedu.openplateform.manager.dao.CustomerMapper;
import com.qfedu.openplateform.manager.entity.Customer;
import com.qfedu.openplateform.manager.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class CustomerServiceImpl implements CustomerService {


    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public List<Customer> findAllCustomer(Customer customer) {
        return customerMapper.findAllCustomer(customer);
    }

    @Override
    public void addCustomer(Customer customer) {
        customerMapper.addCustomer(customer);
    }

    @Override
    public void updateCustomer(Customer customer) {
        customerMapper.updateCustomer(customer);
    }

    @Override
    public void deleteCustomer(Integer[] ids) {
        for (Integer id : ids) {
            customerMapper.deleteCustomer(id);
        }
    }

    @Override
    public List<Customer> findAllCustomerUser() {
        return customerMapper.findAllCustomerUser();
    }
}
